const { createProxyMiddleware } = require('http-proxy-middleware')

module.exports = function (app) {
  app.use(createProxyMiddleware('/v1', {
    target: 'http://106.14.82.240:3000/api',
    secure: false,
    changeOrigin: true,
    // pathRewrite: {
    //   "^/api": "/api"
    // }
  }))
  app.use(createProxyMiddleware('/api', {
    target: 'http://106.14.82.240:3000',
    secure: false,
    changeOrigin: true,
    // pathRewrite: {
    //   "^/api": "/api"
    // }
  }))
}
